LL_CRC_DeInit API migration ¶
The LL de-initialization function previously available in the
stm32tnxx_ll_crc.c
file within HAL1 are no longer present in HAL2.
In HAL2, all LL C file (
stm32tnxx_ll_crc.c) have been removed, leaving only the LL header files (
stm32tnxx_ll_crc.h) that contain static inline functions.
If users need to de-initialize CRC using the LL layer, they have only one method:
Replace manually the de-initialization function : Replace the
LL_CRC_DeInitfunction manually with equivalent sequences using the static inline functions provided in thestm32tnxx_ll_crc.hfile, tailored to their specific configuration and requirements.
This approach ensures that the de-initialization sequence is precisely addressing the given use case based on the LL static inline functions provided in the
stm32tnxx_ll_crc.h
header file.
Related concept:
Method 1: Utilize STM32CubeMX2 Code Generation ¶
Create a new project with the STM32CubeMX2, then select the CRC and start the initialization and configuration.
Generated CRC de-initialization sequence ¶
The CRC de-initialization sequence is generated in the
mx_crc_deinit
function in
mx_crc.c
file under
$YOUR_PROJECT_NAME$/$YOUR_PROJECT_NAME$_SW/generated/STM32Cube_CodeGen.
|
HAL1 |
HAL2 |
|---|---|
static void MX_CRC_DeInit(void)
{
LL_CRC_DeInit();
}
|
void mx_crc_ll_deinit(void)
{
LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC);
LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC);
}
|
Method 2: Replace manually the de-initialization functions ¶
LL_CRC_DeInit() API migration ¶
According to the used CRC, Implement the precise calls to
LL_AHB1_GRP1_ForceReset()
and
LL_AHB1_GRP1_ReleaseReset
|
HAL1 |
HAL2 |
|---|---|
LL_CRC_DeInit();
|
LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC);
LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC);
|